// Decompiled by Jad v1.5.8g. Copyright 2001 Pavel Kouznetsov.
// Jad home page: http://www.kpdus.com/jad.html
// Decompiler options: packimports(3) 
// Source File Name:   QNA5B7.java

package org.quickserver.net.GB268753QN.control;

import java.util.*;
import org.quickserver.net.model.*;
import org.quickserver.net.server.ClientHandler;
import org.quickserver.util.data.dataProcessing;

public class QNA5B7
{

    public QNA5B7()
    {
    }

    public static void QNA5B7OBJ(ClientHandler handler, String strs[], String serialNumber)
    {
        GBServerData ec = (GBServerData)handler.getClientData();
        int total = dataProcessing.hexStringToInt10(strs[1]);
        List Alist = new ArrayList();
        for(int i = 0; i < total; i++)
        {
            int fors = i * 38;
            String WhQh[] = new String[4];
            WhQh[0] = strs[5 + fors];
            WhQh[1] = strs[6 + fors];
            WhQh[2] = strs[7 + fors];
            WhQh[3] = strs[8 + fors];
            String str[] = dataProcessing.reInfo(ec.getDevType(), WhQh);
            String componentExplain[] = dataProcessing.strsToStrs(strs, 9 + fors, (40 + fors) - 1);
            String explain = dataProcessing.gB18030ByteArrayToUtf8String(dataProcessing.hexStringsToByteArray(componentExplain));
            Architecture architecture = new Architecture();
            architecture.setComponentExplain(explain);
            architecture.setSysType(dataProcessing.hexStringToInt10(strs[2 + fors]));
            architecture.setSysAddress(dataProcessing.hexStringToInt10(strs[3 + fors]));
            architecture.setComponentNumType(dataProcessing.hexStringToInt10(strs[4 + fors]));
            if("0101".equals(ec.getDevType()) || "0103".equals(ec.getDevType()))
            {
                architecture.setLoopNumber(Integer.parseInt(str[1]));
                architecture.setComponentNumber(Integer.parseInt(str[2]));
            } else
            if("0102".equals(ec.getDevType()))
                architecture.setTwiceCode(Integer.parseInt(str[0]));
            Alist.add(architecture);
        }

        Map map = new HashMap();
        map.put("architecture", Alist);
        List list = ec.getSerialNumberList();
        for(int i = 0; i < list.size(); i++)
        {
            GB26875SetUp gs = (GB26875SetUp)list.get(i);
            if(!gs.getSerialNumber().equals(serialNumber))
                continue;
            ((GB26875SetUp)list.get(i)).setTrue(true);
            ((GB26875SetUp)list.get(i)).setOk(true);
            ((GB26875SetUp)list.get(i)).setDataMap(map);
            break;
        }

    }
}
